Module 3 : Managing Systems with Ansible
Managing Software with Ansible
- Understanding Modules for managing processes and Tasks
- To manage software on RHEL systems, different tasks need to be managed
- Systems need to be subscribed
- Repos and software channels need to be configured
- Software needs to be installed and removed
- Modules to install packages :
- other modules:
- rpm_key : adds/removes GPG keys from an rpm package db
- redhat_subscription: uses the subscription_manager command to manage subs
- rhn_register: managed redhat network registration using rhnreg_ks
- rhn_channel: Manages RHN channel subscription
- Implementing a playbook to manage processes and tasks
Managing Users
- Understanding Modules Related to User management
- user module: to manage users and their common properties
- group module: manages groups and their common properties
- pamd: configures PAM (pluggable authorization modules
- authorized_key: copies SSH public keys from Ansible control to the target user .ssh/authorized_keys
- This module does not generate any ssh keys to do so, use the user module and generate_ssh_key argument
- lineinfile: modifies configs files based on regex
- Implementing a Playbook to Manage Users
Managing Processes and Tasks
- Understanding Modules for Managing Processes and Tasks
- cron: Uses cron to schedule a job
- at: Uses at to run a future job
- file: Because some tasks simple don’t have a specific Ansible module
- service: Manages services
- service_facts: uses infos about services as facts.
- systemd: Manages systemd services
- Implementing a Playbook to Manage Processes and Tasks
Managing Storage
- Understanding Modules for Managing Storage
- parted: runs the parted utility
- lvg: create LVM volume group
- lvol: create LVM logical volumes
- filesystem: managed filesystems
- Implementing a Playbook to Manage Storage
Managing Network
- Using the network system role:
- RHEL system roles are used to manage networking
- use ansible-galaxy list for an overview of all rhel roles
- check contents of the roles in /usr/share/ansible/roles
- Setting variables:
- Two common variables are used to configure the network role:
- network_provides: typically set to nm
- network_connections: specifies details about the network connection
- Defaults for these variables are set in /usr/share/ansible/roles/rhel-system-roles.network
- Understanding Modules for network management
- nmcli: is used to manage many params for network devices or connections
- hostname: set the name of managed host
- firewalld: can be used to manage firewall rules